import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCommonStore = defineStore('common', () => {
  const excludeList = ref([])
  const includeList = ref(['industryLayout'])
  
  const unitOption = ref([
    {label: 'kg', value: 1},
    {label: 'g', value: 2},
    {label: '株', value: 3},
    {label: '棵', value: 4},
    {label: '支', value: 5},
    {label: '袋', value: 6},
    {label: '瓶', value: 7},

  ])

  const unitOptionName = (value: number) => {
    for(let item of unitOption.value){
      if(item.value == value){
        return item.label
      }
    }
  }

  return { excludeList,includeList, unitOption, unitOptionName }
})
